#pragma once

#include "CoreMinimal.h"
#include "Engine/DataTable.h"

#include "Study/Prop/Tribute.h"
#include "Study/Lib/Static.h"

#include "Tributes.generated.h"

USTRUCT(BlueprintType)
struct FTributes : public FTableRowBase {

	GENERATED_BODY()

	UPROPERTY(EditAnywhere, BlueprintReadWrite)
	FString Title;

	UPROPERTY(EditAnywhere, BlueprintReadWrite)
	ETributeType Type;

	UPROPERTY(EditAnywhere, BlueprintReadWrite)
	UMaterial* Material;

	UPROPERTY(EditAnywhere, BlueprintReadWrite)
	FString TributeBP;

	static UDataTable* GetInstance() {
		return LoadObject<UDataTable>(NULL, *FStatic::TributesBP);
	}

	static FTributes* Get(const FString Key, const FString Field = FString()) {
		return GetInstance()->FindRow<FTributes>(*Key, Field);
	}

	static bool IsExist(const FString Key) {
		return Get(Key) != NULL;
	}
};